import java.util.Map;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 强仔
 * Date: 2022-05-01
 * Time: 15:15
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] team = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            team[i] = scanner.nextInt();
        }

        int k = scanner.nextInt();
        int d = scanner.nextInt();

        long[][] maxF = new long[n + 1][k + 1];
        long[][] minF = new long[n + 1][k + 1];

        // 初始化状态
        for (int i = 1; i <= n; i++) {
            maxF[i][1] = team[i];
            minF[i][1] = team[i];
        }


        for (int i = 1; i <= n; i++) {
            for (int j = 2; j <= k; j++) {

                if(i < j){
                 continue;
                }

                long max = Long.MIN_VALUE;
                long min = Long.MAX_VALUE;
                for (int m = i - 1; m >= i - d && m >= j - 1; m--) {
                    max = Math.max(max, Math.max(maxF[m][j - 1] * team[i], minF[m][j - 1] * team[i]));
                    min = Math.min(min, Math.min(minF[m][j - 1] * team[i], maxF[m][j - 1] * team[i]));
                }
                maxF[i][j] = max;
                minF[i][j] = min;
            }
        }

        long result = Long.MIN_VALUE;
        for (int i = 1; i <= n; i++) {
            result = Math.max(result, maxF[i][k]);
        }
        System.out.println(result);
    }


}
